Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 5 | ||
Bugs | 0 | Features | 0 |
1 | const targets = Array.from(document.body.querySelectorAll('input[data-mapsfield=mapsfield]')); |
||
8 | const fillAddress = () => { |
||
9 | const event = new Event('change'); |
||
|
|||
10 | const location = autoComplete.getPlace(); |
||
11 | const components = location.address_components; |
||
12 | |||
13 | latField.setAttribute('value', location.geometry.location.lat()); |
||
14 | lngField.setAttribute('value', location.geometry.location.lng()); |
||
15 | |||
16 | components.forEach((component) => { |
||
17 | component.types.forEach((type) => { |
||
18 | const field = document.getElementById(type); |
||
19 | if (field) { |
||
20 | field.setAttribute('value', component.long_name); |
||
21 | field.dispatchEvent(event); |
||
22 | } |
||
23 | }); |
||
24 | }); |
||
25 | }; |
||
26 | |||
35 | } |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.